﻿@model MvcBoard.Models.Post   

@{
    //상단에 모델과 연결된 형태 @model xxxx.xxx 를  Strongly typed View라 한다.
    ViewBag.Title = "신규";
    
}

<h2>Create</h2>

@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    
    @*
     모델 바인딩 
     람다식 즉 @Html.TextBoxFor(m => m.name) 형식의 입력요소와 관련하여 속성을 쉽게(인텔리센스)하게 지정가능하다.
    *@    
    
    <table class="tbl_basic">
        <tr>
            <th style="width: 10%;"> 이름 </th>
            <td>@Html.TextBoxFor(m => m.name)</td>  
        </tr>
        <tr>
            <th> 제목</th>
            <td>@Html.TextBoxFor(m => m.subject)</td>
        </tr>
        <tr>
            <th>내용</th>
            <td>@Html.TextAreaFor(m => m.content, new { row = 40 })</td>
        </tr>
    </table>
        <p>
            <input type="submit" value="저장" />
        </p>
    
@*
    <fieldset>
        <legend>Post</legend>


        <div class="editor-label">
            @Html.LabelFor(model => model.name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.name)
            @Html.ValidationMessageFor(model => model.name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.subject)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.subject)
            @Html.ValidationMessageFor(model => model.subject)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.content)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.content)
            @Html.ValidationMessageFor(model => model.content)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.writetime)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.writetime)
            @Html.ValidationMessageFor(model => model.writetime)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.readCount)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.readCount)
            @Html.ValidationMessageFor(model => model.readCount)
        </div>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>*@
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
